	<?php
		if(isset($_POST['api_key'])) {
			update_option('api_key', $_POST['api_key']);
			?>
			<div class="updated"><p><strong>Options Saved</strong></p></div>
			<?php
		}
		
		
		 $api_key = get_option('api_key');  
		 
		 if(@hukd_test_key($api_key))
		 {
		 		$current_key_validity='<b style="color:#090">valid</b>';

		 }
		 else
		 {
		 		$current_key_validity='<b style="color:#f00">invalid</b>';
		 }
	?>
	
	
	
		<div class="wrap">
			<h2>wp-hukd options</h2>
			<form name="oscimp_form" method="post" action="<?php echo str_replace( '%7E', '~', $_SERVER['REQUEST_URI']); ?>">
			
				<p>HUKD API KEY<input type="text" name="api_key" value="<?php echo $api_key; ?>" size="20"> <?=$current_key_validity;?></p>
			
				<hr />
	 <input type="submit" name="Submit" value="Update Options" />  
				</p>
			</form>
		</div>
	